package com.yuzhitong.shapi.model;

import com.yuzhitong.shapi.base.Contents;
import com.yuzhitong.shapi.base.net.BaseListBean;
import com.yuzhitong.shapi.base.net.BaseObjectBean;
import com.yuzhitong.shapi.bean.AdStatusBean;
import com.yuzhitong.shapi.bean.DomainBean;
import com.yuzhitong.shapi.bean.HomeListBean;
import com.yuzhitong.shapi.bean.NavigationBean;
import com.yuzhitong.shapi.contract.HomeContract;
import com.yuzhitong.shapi.contract.NavigationContract;
import com.yuzhitong.shapi.contract.StartContract;
import com.yuzhitong.shapi.net.RetrofitClient;

import java.util.Map;

import io.reactivex.rxjava3.core.Observable;

/**
 * @ClassName: TestModel
 * @Author: 70488
 * @CreateDate: 2020/07/18 15:03
 * @UpdateRemark: 更新说明：
 * @Description: 启动页
 */
public class MainModel implements StartContract.Model, HomeContract.Model, NavigationContract.Model {
    @Override
    public Observable<BaseObjectBean<DomainBean>> getUrl(Map<String, Object> par) {
        return RetrofitClient.getInstance().getApi().getUrlTop(par);
    }
    @Override
    public Observable<BaseListBean<AdStatusBean>> getAdState(Map<String, Object> par) {
        return RetrofitClient.getInstance().getApi().adState(Contents.BASE_URL + "/adState/getValue", par);
    }

    @Override
    public Observable<BaseObjectBean<String>> getSearchUrl(Map<String, Object> par) {
        return RetrofitClient.getInstance().getApi().search(Contents.BASE_URL + "/search/getUrl", par);
    }

    @Override
    public Observable<BaseListBean<NavigationBean>> getNavigationList(Map<String, Object> par) {
        return RetrofitClient.getInstance().getApi().navigationList(Contents.BASE_URL + "/link/list", par);
    }

    @Override
    public Observable<BaseListBean<HomeListBean>> getHomeList(Map<String, Object> par) {
        return RetrofitClient.getInstance().getApi().homeList(Contents.BASE_URL + "/link/home", par);
    }
}
